﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace welding
{
    /// <summary>
    /// 处理与设备相关的
    /// </summary>
   class Device
    {
        private DeviceInfomation deviceInfomation;
        public Device(DeviceInfomation deviceInfomation)
        {
            this.DeviceInfomation = deviceInfomation;
        }

        public string DeviceCommand(int command,string reason)
        {
            string _cmd = cmdHeader;
            _cmd += DateTime.Now.ToString("HHmmss") + ",";
            _cmd += this.DeviceInfomation.DeviceId + ",";
            _cmd += command.ToString() + ",";
            _cmd += DateTime.Now.ToString() + ",";
            _cmd += reason;
            return _cmd;
        }

        private string cmdHeader = "DEVICE,";

        internal DeviceInfomation DeviceInfomation { get => deviceInfomation; set => deviceInfomation = value; }
    }
}
